home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / DTS QT Utilities.Aug-95 / Projects & Test Apps / MovieShell / TestFunctions.c < prev    next >
Encoding:
Text File  |  1995-05-29  |  1.1 KB  |  53 lines  |  [TEXT/MPCC]

  1. /*
  2.     File:        TestFunctions.c
  3.  
  4.     Contains:    Insert the test functions inside this file.
  5.  
  6.     Written by:    DTS
  7.  
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.         <1>         2/26/95    khs        first file
  13.        
  14. */
  15.  
  16.  
  17. // INCLUDES
  18. #include "TestFunctions.h"
  19.  
  20. #include "DTSQTUtilities.h"
  21. #include "MacFramework.h"
  22.  
  23.  
  24. // TEST FUNCTIONS
  25. // ______________________________________________________________________
  26. void ResizeTheMovieWindow(long theMovieSize)
  27. {
  28.     MovieController     mc = NULL;
  29.     Rect                         originalRect;
  30.     WindowRef            aWindow = NULL;
  31.     WindowObject         aWindowObject = NULL;
  32.     
  33.     // We need all this code below
  34.     aWindow = FrontWindow();                            // do we have a window?
  35.     if(aWindow == NULL)
  36.     {
  37.         SysBeep(10);
  38.         return;
  39.     }
  40.             
  41.     mc = GetMCFromFrontWindow();                    // does the front window have a movie controller?
  42.     if(mc == NULL)
  43.     {
  44.         SysBeep(10);
  45.         return;
  46.     }
  47.     
  48.     aWindowObject = (WindowObject)GetWRefCon(aWindow); DebugAssert(aWindowObject != NULL);
  49.     originalRect = (**aWindowObject).originalSize;
  50.  
  51.     if ( QTUResizeMCWindow(mc, (WindowPtr) aWindow, theMovieSize,  originalRect) != noErr)
  52.         SysBeep(10);
  53. }